﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Jacaranda.Model;

namespace Jacaranda.Rules
{
    public class EqualToOrGreatorThan : ValidationRule
    {
        public EqualToOrGreatorThan(double value)
        {
            Value = value;
        }

        public double Value { get; private set; }

        public override bool Validate(Entity entity, string propertyName, object propertyValue)
        {
            return propertyValue == null || Convert.ToDouble(propertyValue) >= Value;
        }
    }
}
